﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;


namespace PoolGame2.Assets
{
    public class ModelDatabase
    {
        private Dictionary<string, Model> modelDB;
        private PoolGame parent;

        public ModelDatabase(PoolGame game)
        {
            parent = game;
            modelDB = new Dictionary<string, Model>(20);
        }

        public Model loadModel(string modelFile)
        {
            if (modelDB.ContainsKey(modelFile))
            {
                return modelDB[modelFile];
            }

            Model loaded = parent.Content.Load<Model>(modelFile);
            modelDB.Add(modelFile, loaded);
            return loaded;
        }

    }
}
